package com.zyh.homeworkzhuantike;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        /*
        2.	根据成绩输出对应的等级，使用if语句实现。（7分）
            a)	A级   [90,100]
            b)	B级   [80,90)
            c)	C级   [70,80)
            d)	D级   [60,70)
            e)	E级   [0,60)
         */
//        输出提示语并接收成绩
        System.out.println("请输入成绩：");
        double score = new Scanner(System.in).nextDouble();
        if (score < 0 || score > 100) {
            System.out.println("输入有误！");
            return;
        }
        switch ((int) (score / 10)) {
            case 6:
                System.out.println("D");
                break;
            case 7:
                System.out.println("C");
                break;
            case 8:
                System.out.println("B");
                break;
            case 9:
            case 10:
                System.out.println("A");
                break;
            default:
                System.out.println("E");
        }
    }
}
